<template>
  <div>
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="公告名称">
        <el-input v-model="form.title"></el-input>
      </el-form-item>
            <el-form-item label="发布单位">
        <el-input v-model="form.from"></el-input>
      </el-form-item>
      <el-form-item label="发布时间" style="text-align:left;">
    <el-date-picker
      value-format="yyyy-MM-dd HH:mm:ss"
      v-model="form.date1"
      type="datetime"
      placeholder="选择日期时间">
    </el-date-picker>
      </el-form-item>
      <el-form-item label="公告内容">
        <el-input type="textarea" v-model="form.article"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">立即修改</el-button>
        <el-button>重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import http from '@/api/adminapi'
export default {
  name: "",
  data() {
    return {
      form: {
        name: "",
        title:"",
        from:"",
        date1: "",
        article:""
      },
    };
  },
  methods: {
    async onSubmit() {
      let res=await http.editpub(this.form);
      if(res.status==200){
        this.$Toast({
          content:res.data.msg,
          type:res.data.type
        })
      }
      this.$store.dispatch("getpubinfo");
    },
  },
  mounted() {},
};
</script>

<style lang="less" scoped>

</style>
